<template>
  <div>
<el-input placeholder="输入事项" v-model="detail"></el-input><el-button type="primary" plain @click="getVal">添加</el-button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      detail: ''
    }
  },
  methods: {
    getVal () {
      this.$store.commit('add', this.detail)
    }
  }
}
</script>

<style scoped>
.el-input{
  width: 200px;;
  margin-right: 10px;;
}
</style>
